#!/bin/sh
#
# Copyright (c) 2013 Qualcomm Atheros, Inc.
# Copyright (C) 2011-2012 OpenWrt.org
#

. /lib/ar71xx.sh
. /lib/gpio-button-hotplug.sh
. /lib/functions.sh

board=$(ar71xx_board_name)

# If the button config was already provisionned on the FS, then we do nothing
is_button_set=
button_set() {
	is_button_set=1;
}
local button
config_load system
config_foreach button_set button
[ "${is_button_set}" == "1" ] && exit 0;

case "$board" in
cus227)
	button_add_uci_config "pressed" "BTN_2" "mtd -r erase rootfs_data"
	;;
esac

exit 0
